package com.fundynamic.learnbydoing.designpatterns.statePattern.withPattern.domain;


/**
 * The state pattern describes that a state is an object of itself. Not an enum. 
 * 
 * The state pattern has a 'state context', this is its source where it can update
 * the state of the program. In this case, it would be a reference to the User object.
 * 
 * @author Stefan
 *
 */
public abstract class RegistrationState {
	
	final private User user;
	
	public RegistrationState(User user) {
		this.user = user;
	}

	final protected void setRegistrationState(RegistrationState newState) {
		user.setRegistrationState(newState);
	}
	
	public abstract void update();
}
